﻿@namespace MudBlazor
@inherits MudBooleanInput<T>
@typeparam T

<label class="@Classname" style="@Style">
    <span class="mud-switch-span mud-flip-x-rtl">
        <span class="@SwitchClassname">
            <span class="mud-switch-button">
                <input @attributes="UserAttributes" aria-checked="@((BoolValue == true).ToString().ToLower())" aria-readonly="@(Disabled.ToString().ToLower())" type="checkbox" class="mud-switch-input" checked="@BoolValue" @onchange="@OnChange" disabled="@Disabled" @onclick:preventDefault="@ReadOnly"/>
                <span class="mud-switch-thumb"></span>
            </span>
        </span>
        <span class="mud-switch-track"></span>
    </span>
    @if (!String.IsNullOrEmpty(Label))
    {
        <MudText>@Label</MudText>
    }
    @if (ChildContent != null)
    {
        <MudText>
            @ChildContent
        </MudText>
    }
</label>

@code
{
    [Parameter] public RenderFragment ChildContent { get; set; }
}

